
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html class="no-js" lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="__HOME_CSS__/newdsn/css/jquery-ui.css">

        <link rel="stylesheet" href="__HOME_CSS__/newdsn/css/admin.css">
        <script type="text/javascript" src="__HOME_JS__/js/jquery-1.11.3.min.js"></script>
        <script type="text/javascript" src="__HOME_JS__/js/laydate/laydate.min.js"></script>
        <script type="text/javascript" src="__HOME_JS__/newdsn/js/cash/admin_content.js"></script>
        <script type="text/javascript" src="__HOME_JS__/js/dialog.js"></script>
        <script type="text/javascript" src="__HOME_JS__/js/libs.js"></script>

    </head>
    <body id="bodyid" class="skin_blue">
<include file="Public/user_nav" />
<script type="text/javascript">
  $(function() {
    $(".tabnavi2").click(function() {
      $(".tabnavi2").removeClass("tabnaviactive2");
      $(this).addClass("tabnaviactive2");
      var indexnum = $(this).index();
      $(".tabbox2").css("display", "none");
      $(".tabbox2:eq(" + indexnum + ")").css("display", "block");
    });

  });

  function saveAddress() {
    var Consignee = $('#txtConsignee').val();
    var Address = $('#txtAddress').val();
    var Consignee_mobile = $('#txtMobile').val();

    if (Address == '') {
      dialog.error('消息', '地址不能为空！');
      $('#content').focus();
      return;
    }
    if (Consignee == '') {
        dialog.error('消息', '收货人不能为空！');
        $('#content').focus();
        return;
      }   
    if (Consignee_mobile == '') {
          dialog.error('消息', '手机号不能为空！');
          $('#content').focus();
          return;
        }
	if(!(/^[1][3-8]\d{9}$/.test(Consignee_mobile))){
		dialog.error('消息', '手机格式错误！');
		return;
	}
    $.ajax({
      url : 'saveAddress',
      type : 'POST',
      loading : true,
      dataType: "json",
      data : {
    	  Consignee:Consignee,
    	  Consignee_Mobile : Consignee_mobile,
    	  Address : Address,
    	  
      },
      success : function(res) {
        if (res.success) {
          dialog.alert('消息',res.message,null,'/index.php/UserCenter/index');

        } else {
          dialog.error('消息',res.message);
        }
      }
    });
  }
</script>

 
 <div class="rightpanel">       
	<div class="contentcontainer">
          <div class="row pagetitle">
                      <span class="bluepagetitle">地址信息</span>  填写真实资料，逢年过节时，我们可能给忠实会员派送小礼物哦！ 
                    </div>
                    <div class="row">
                      <div class="col1">收货地址 :</div>
                        <div class="col2"><input type="text" class="textbox2 textbox3" id="txtAddress" value="{$user.address}"></div>
                    </div>
                 <!--    <div class="row">
                      <div class="col1">街道 :</div>
                        <div class="col2"><input type="text" class="textbox2 textbox3" id="txtStreet" value=""></div>
                    </div> -->
                    <div class="row">
                      <div class="col1">收 货 人 :</div>
                        <div class="col2"><input type="text" class="textbox2" id="txtConsignee" value="{$user.Consignee}"></div>
                    </div>
                    <div class="row">
                      <div class="col1">收货手机 :</div>
                        <div class="col2"><input type="text" class="textbox2" id="txtMobile" value="{$user.Consignee_mobile}"></div>
                    </div>
                    <div class="row">
                      <div class="col1">&nbsp;</div>
                        <div class="col2"><button class="btnsubmit" type="submit" onclick="saveAddress()">保存</button></div>
                    </div>
                
                </div>
            </div>
    </body>
</html>